<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加产品类别</title>
    <!-- 引入 layui.css -->
    <link rel="stylesheet" th:href="@{/css/font.css}">
    <link rel="stylesheet" th:href="@{/css/xadmin.css}">
    <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
    <script type="text/javascript" th:src="@{/js/xadmin.js}"></script>
    <META content="MSHTML 6.00.2900.5626" name=GENERATOR></HEAD>
</head>
<body>
<script  type="text/javascript">
    function addOK(){
        var id=$("#id").val();
        var MaterialNumber=$("#MaterialNumber").val();
        var NameOfGoods=$("#NameOfGoods").val();
        var MaterialDescription=$("#MaterialDescription").val();
        $.ajax({
            url: "/MaterialType/updateMaterialTypeOK.html",
            data:{
                "id":id,
                "MaterialNumber":MaterialNumber,
                "NameOfGoods":NameOfGoods,
                "MaterialDescription":MaterialDescription,
            },
            type: "POST",
            success: function (result) {
                // alert(result);
                if(result>0){
                    // alert("修改成功") ;
                    layer.msg('温馨提示，修改成功')
                    location.href="/supplier/product_category_maintenance.html";


                }
                else{
                    // alert("修改失败");
                    layer.msg('温馨提示，修改失败')

                }
            },
        })
    }
</script>
<table class="layui-table"  cellpadding="3" cellspacing="1" border="0" width="100%">
    <tr bgColor=#ffffff>
        <td align=middle width="100%" bgColor=#ffffff colSpan=20 height=22>
            <H2>
                <b color=#0070c0>修改产品类别</b>
            </H2>
        </td>
    </tr>
    <tr>

        <td class="t1" nowrap="" width="10%">类别编号</td>
        <td class="t2" nowrap="" width="30%">
          <input type="hidden"  th:value="${m.id}"  id="id" name="id">
            <input type="text"  th:value="${m.MaterialNumber}" name="MaterialNumber" id="MaterialNumber" required  lay-verify="required" placeholder="请输入类型编号" autocomplete="off" class="layui-input">
        </td>
        <td class="t1" nowrap="" width="10%">类别名称</td>
        <td class="t2" nowrap="" width="30%">
            <input type="text"   th:value="${m.NameOfGoods}"   id="NameOfGoods" name="NameOfGoods" required  lay-verify="required" placeholder="请输入类型名称" autocomplete="off" class="layui-input">
        </td>
    </tr>
    <tr>
        <td class="t1" nowrap="" width="10%">描述</td>
        <td class="t2" nowrap="" width="30%" colspan="3">
            <textarea name="MaterialDescription"     id="MaterialDescription" rows="4" style="width:100%">[[${m.MaterialDescription}]]</textarea>
        </td>
    </tr>
    <tr>
        <td class="t2" nowrap="" width="40%" colspan="4" align=middle>
            <button type="button" onclick="addOK()" class="layui-btn">保存返回</button>
            <button type="button"  class="layui-btn layui-btn-primary" onClick="history.back()">直接返回</button>
        </td>
    </tr>
</table>
</body>
</html>